package com.qd.common.panda.domain.entity.carpark;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 停车场介绍图片
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
@JsonIgnoreProperties(value = {"fileId", "attachmentType", "pageNumber", "pageSize", "beginTime", "endTime", "sqlParams", "sysParams", "asc", "desc", "orgIds"}, allowSetters = true)
public class CarParkImgDTO extends BaseQuery {

    @ExcelIgnore
    @JsonIgnore
    private static final String EXCEL_TITLE = "停车场介绍图片";
    /**
     * 主键
     */
    @ExcelProperty(value = {EXCEL_TITLE, "ID"})
    @NotBlank(message = "ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String id;
    /**
     * 名称
     */
    @ExcelProperty(value = {EXCEL_TITLE, "名称"})
    @Size(max = 100, message = "名称长度不能超过{max}位", groups = DefaultGroup.class)
    private String picName;
    /**
     * 路径
     */
    @ExcelProperty(value = {EXCEL_TITLE, "路径"})
    private String picPath;
    /**
     * 绝对路径
     */
    private String picPathDisplay;
    /**
     * 排序
     */
    @ExcelProperty(value = {EXCEL_TITLE, "排序"})
    private Integer idx;
    /**
     * 停车场标识
     */
    @ExcelProperty(value = {EXCEL_TITLE, "停车场标识"})
    @NotBlank(message = "停车场标识不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "停车场标识长度不能超过{max}位", groups = DefaultGroup.class)
    @JsonProperty("pId")
    private String pId;
    /**
     * 附件ID，从文件上传接口获得
     */
    @Size(max = 50, message = "附件ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String fileId;
    /**
     * 附件类型
     */
    @Size(max = 50, message = "附件类型长度不能超过{max}位", groups = DefaultGroup.class)
    private String attachmentType;


    @Override
    public void freeData() {
        this.id = null;
        this.picName = null;
        this.picPath = null;
        this.picPathDisplay = null;
        this.idx = null;
        this.pId = null;
        this.fileId = null;
        this.attachmentType = null;
        super.freeData();
    }
}
